﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ORAProvider
{
    public interface IBaseStore<T, in TKey> : IDisposable
    {
        /// <summary>
        ///     Create a new role
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        bool CreateRow(T row);

        /// <summary>
        ///     Update a role
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        bool UpdateRow(T row);

        /// <summary>
        ///     Delete a role
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        bool DeleteRow(T row);

        /// <summary>
        ///     Find a role by id
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        T FindByIdRow(TKey rowId);

        /// <summary>
        ///     Find a role by name
        /// </summary>
        /// <param name="roleName"></param>
        /// <returns></returns>
        T FindBySql(string sSql);
    }
}
